<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
</head>
<body>

<p>点击按钮修改第一个 iframe 的 src 值 (索引为 0)。</p>

<button onclick="myFunction()">点我</button>
<br><br>

<iframe src="http://c.runoob.com">
</iframe>
<!--<iframe src="http://m.runoob.com"></iframe>-->

<script>
    function myFunction() {
        // window.frames[0].location = "http://www.runoob.com";
        console.log(window.frames);
    }
</script>

</body>
</html>